package com.newworld.basketballfire.main.dao;

import com.newworld.basketballfire.main.bean.NoteListParam;
import com.newworld.basketballfire.main.dao.mapper.NoteMapper;
import com.newworld.basketballfire.service.model.Note;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created by George on 2019/4/21.
 * NoteDao
 */
@Component
public class NoteDao {

    @Autowired
    private NoteMapper noteMapper;

    public void addNote(Note note) {
        noteMapper.addNote(note);
    }

    public void updateNote(Note note) {
        noteMapper.updateNote(note);
    }

    public Note getNote(String id) {
        return noteMapper.getNote(id);
    }

    public void deleteNote(String id) {
        noteMapper.deleteNote(id);
    }

    public List<Note> getNoteList(NoteListParam noteListParam) {
        return noteMapper.getNoteList(noteListParam);
    }

    public int getNoteListTotalCnt(NoteListParam noteListParam) {
        return noteMapper.getNoteListTotalCnt(noteListParam);
    }
}
